package com.huixue.cn.ztej.base;

import java.util.Arrays;

import org.apache.commons.dbcp.BasicDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.huixue.cn.ztej.utils.MD5;

public class dfgd {
	public static void main(String[] args) {
		/*String s="F:\\MyEclipse2013\\Workspaces\\.metadata\\.me_tcat7\\webapps\\ZTERWeChat\\upload/465a2bca066645578e3a1fb692445deb.jpg";
	    String[] split = s.split("\\\\");
	    System.out.println(split[6]+split[7]);*/
		
		/*String s = "/ZTERWeChat";
		String t = s.replace("/", "\\");
		System.out.println(t);
		
		String s1 = "/opt/apache-tomcat-7.0.73/webapps/ZTERWeChat/upload/b1b292845f184055a6885ee3995c433c.jpg";
		String []t1 = s1.split("\\/");
		
		String dd = "/ZTERWeChat/upload/61b6c71a2b414451bf663333123cbf65.jpg";
		
		dd = dd.replace("/ZTERWeChat", "");
		System.out.println(dd);
		System.out.println(Arrays.deepToString(t1));
		
		System.out.println(MD5.md5("lms123456!"));*/
		
		try{
			String[] path = {"src/main/resources/applicationContext.xml"};
			ApplicationContext ctx = new FileSystemXmlApplicationContext(path);
			BasicDataSource ds = (BasicDataSource)ctx.getBean("dataSource");
			System.out.println("==="+ds.getUsername());
		}catch(Exception e){
			System.out.println(e.getMessage());
		}
	}

}
